package com.visitor.demo2;

import java.util.ArrayList;
import java.util.List;

//Context 环境角色
public class Context {

	List<MyGraphic> list = new ArrayList();

    public void add(MyGraphic node) {
        list.add(node);
    }

    public void visit(GraphicVisitor visitor) {
        for(MyGraphic node : list){
            node.accept(visitor);
        }
    }

}
